package com.yang.mybatis.config;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class MybatisMapperXmlConfiguration implements Serializable {
    private String mapperName;

    private List<MybatisSqlStatement> mybatisSqlStatements = new ArrayList<>();

    private Map<String, MybatisResultMap> mybatisResultMaps = new HashMap<>();


    public List<MybatisSqlStatement> getMybatisSqlStatements() {
        return mybatisSqlStatements;
    }

    public void setMybatisSqlStatements(List<MybatisSqlStatement> mybatisSqlStatements) {
        this.mybatisSqlStatements = mybatisSqlStatements;
    }

    public List<MybatisResultMap> getMybatisResultMaps() {
        return new ArrayList<>(mybatisResultMaps.values());
    }


    public void addMybatisSqlStatement(MybatisSqlStatement mybatisSqlStatement) {
        this.mybatisSqlStatements.add(mybatisSqlStatement);
    }

    public void addMybatisResultMap(MybatisResultMap mybatisResultMap) {
        this.mybatisResultMaps.put(mybatisResultMap.getId(), mybatisResultMap);
    }

    public MybatisResultMap getMybatisResultMap(String id) {
        return this.mybatisResultMaps.get(id);
    }

    public String getMapperName() {
        return mapperName;
    }

    public void setMapperName(String mapperName) {
        this.mapperName = mapperName;
    }
}

